package com.student.management.root.bean;

import java.util.List;
import java.util.Objects;

public class Role {
    private int roleid;
    private String rolename;
    private int rolestate;
    private List<Users> usersList;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Role)) return false;
        Role role = (Role) o;
        return getRoleid() == role.getRoleid() &&
                getRolestate() == role.getRolestate() &&
                Objects.equals(getRolename(), role.getRolename()) &&
                Objects.equals(getUsersList(), role.getUsersList()) &&
                Objects.equals(getMenuList(), role.getMenuList());
    }

    public Role() {
    }

    @Override
    public int hashCode() {
        return Objects.hash(getRoleid(), getRolename(), getRolestate(), getUsersList(), getMenuList());
    }

    @Override
    public String toString() {
        return "Role{" +
                "roleid=" + roleid +
                ", rolename='" + rolename + '\'' +
                ", rolestate=" + rolestate +
                ", usersList=" + usersList +
                ", menuList=" + menuList +
                '}';
    }

    public List<Users> getUsersList() {
        return usersList;
    }

    public void setUsersList(List<Users> usersList) {
        this.usersList = usersList;
    }

    public List<Menu> getMenuList() {
        return menuList;
    }

    public void setMenuList(List<Menu> menuList) {
        this.menuList = menuList;
    }

    private List<Menu> menuList;

    public Role(List<Menu> menuList) {
        this.menuList = menuList;
    }

    public Role(int roleid, String rolename, int rolestate, List<Menu> menuList) {
        this.roleid = roleid;
        this.rolename = rolename;
        this.rolestate = rolestate;
        this.menuList = menuList;
    }

    public int getRoleid() {
        return roleid;
    }

    public void setRoleid(int roleid) {
        this.roleid = roleid;
    }

    public String getRolename() {
        return rolename;
    }

    public void setRolename(String rolename) {
        this.rolename = rolename;
    }

    public int getRolestate() {
        return rolestate;
    }

    public void setRolestate(int rolestate) {
        this.rolestate = rolestate;
    }
}
